package org.laowenchao.client.model;


import java.io.Serializable;

import com.extjs.gxt.ui.client.data.BaseTreeModel;

public class Folder extends BaseTreeModel implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2374324625948427381L;
	public final static long ROOT = -1;
	public final static long ID = -2;

	
	public Folder(){
	}
	
	public Folder(long id,String name) {
		set("id", id);
		set("name",name);
	}


	public Folder(long id,String name,Folder parent) {
		set("id", id);
		set("name",name);
		parent.add(this);
	}

	public Folder(long id,String name, BaseTreeModel[] children) {
		this(id,name);
		for (int i = 0; i < children.length; i++) {
			add(children[i]);
		}
	}

	public Integer getId() {
		return (Integer) get("id");
	}

	public String getName() {
		return (String) get("name");
	}

	public String toString() {
		return getName();
	}

}
